# Contributor: Julien MISCHKOWITZ <wain@archlinux.fr>
pkgname=compiz-deskmenu
pkgver=20090729
pkgrel=1
pkgdesc="Compiz Fusion deskmenu plugin"
arch=('i686' 'x86_64')
url="http://opencompositing.org"
license=('GPL')
depends=('dbus-glib' 'libwnck' 'python-lxml' 'pyxdg' )
makedepends=('git' 'intltool' 'pkgconfig' 'gettext')
install=$pkgname.install
source=()
md5sums=()


_gitroot="git://git.compiz-fusion.org/users/crdlb/compiz-deskmenu"
_gitname="compiz-deskmenu"

build() {
  msg "Connecting to opencompositing.org GIT server...."
 
  if [[ -d $startdir/src/$_gitname ]] ; then
    cd $_gitname
    git-pull origin || return 1
    msg "The local files are updated."
  else
    git clone $_gitroot || return 1
  fi

  msg "GIT checkout done"
  msg "Starting make..."

  # Remove old -build
  rm -rf $startdir/src/$_gitname-build

  cp -r $startdir/src/$_gitname $startdir/src/$_gitname-build
  cd $startdir/src/$_gitname-build

  make || return 1
  make DESTDIR=$startdir/pkg install || return 1
  install -m 755 $startdir/src/$_gitname-build/autoconfig-compiz.py $pkgdir/usr/bin/compiz-deskmenu-autoconfig 

  cd $startdir/src
  rm -rf $_gitname-build
}
